<%--
说明：机构信息表 管理页面

@author liuxun 2012-03-06
--%>
<%@ include file="../../common/common.jsp"%>
<% 
response.setHeader("Pragma","No-cache");
response.setHeader("Cache-Control","no-cache");
response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312"/>
<meta http-equiv="Expires" content="0"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Pragma" content="no-cache"/>
<script>
$(function() {
    var opeForm;
    //防止session过期后，显示重新登录页面在布局框架的右侧。
/*     if(top != self) {
      top.location.href = self.location.href;
    } */
    
    $(function(){
      
      opeForm=$('#opeForm');
      opeForm.url = 'A_ORG!backup.do';
      
 
      $('#saveData').click(userLogin);
      $('#exportData').click(exportData);
	/*   $('#clearBtn').click(refreshWin);     */  
      
      //getUserInfo();
    });
    
    //清空操作（重置）
/*     function clearOperation() {
      opeForm.resetForm();
    } */ 
    
    
    function exportData()
    {
  //      alert("22222");
		    var date = new Date();  
	        var y = date.getFullYear();
			var m = date.getMonth()+1;
			var d = date.getDate();
      
   //    alert(y+(m<10?('0'+m):m)+(d<10?('0'+d):d));
       
       window.location.href="jsp/usraccount/a_html_view/databackup"+y+(m<10?('0'+m):m)+(d<10?('0'+d):d)+".xls";
  
    }
    
     function userLogin() {
      
 //     var validateResult = opeForm.form('validate');
/*       if (!validateResult){
        showInfoWin('请正确填写信息！');  
        return;
      } */
  //    showSystemProccessing();
      var options = { 
          url: opeForm.url,
          type: 'post',
		  success: function(backupMessage){
		  
		  //     alert(backupMessage);
		//		removeSystemProccessing();
				//saveUserInfo();
				if (backupMessage == '1') {
				//	window.location.href = 'showMain.do';
				showInfoWin('数据备份成功！');
				} /* else if (operationType == '99') {
					window.location.href = 'showMustChangePass.do';
				} */
				else
				{
				showInfoWin('数据备份失败！请联系开发人员！');
				}
			},
          error : function (XMLHttpRequest, textStatus, errorThrown) {
              
             showInfoWin('数据备份失败！出现异常！请联系开发人员！');  
          
/*               $('#validateimg').attr('src','showValidateCode.do' +'?timeStamp='+new Date().getTime());
              
              $('#validate').val(""); */
          }
      };
      opeForm.ajaxSubmit(options);
    }
    
 
});     
</script>
<title>数据备份管理</title>
<!-- <script src="jsp/usraccount/a_org/a_org_index.js" type="text/javascript" charset="UTF-8"></script> -->
</head>
<body>
  <form id="opeForm" name="opeForm" method="post">
  <a href="#" id="saveData" class="easyui-linkbutton" plain="true" icon="icon-save">备份数据</a>
  <a href="#" id="exportData" class="easyui-linkbutton" plain="true" icon="icon-save">导出数据</a>
</form>

</body>
</html>